import {Modal} from 'antd';
import React, {PropsWithChildren} from 'react';

interface CreateRecurringFormProps {
  modalVisible: boolean;
  onCancel: () => void;
}

const CreateRecurringFormProps: React.FC<PropsWithChildren<CreateRecurringFormProps>> = (props) => {
  const { modalVisible, onCancel } = props;
 // todo: 后续可以考虑将cron表达式集成，不用去其他地方找了
  return (
    <Modal
      destroyOnClose
      title="添加定时任务"
      width={420}
      open={modalVisible}
      onCancel={() => onCancel()}
      footer={null}
    >
      {props.children}
    </Modal>
  );
};

export default CreateRecurringFormProps;
